package com.seezoon.admin.modules.sys.service;

import com.seezoon.admin.framework.service.IBaseService;
import com.seezoon.dao.framework.dto.Tree;
import com.seezoon.dao.modules.sys.entity.SysDemo;
import com.seezoon.dao.modules.sys.entity.SysDept;
import org.springframework.transaction.annotation.Transactional;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author 黎小荣
 * @since 2023/3/22
 */
public interface ISysDeptService extends IBaseService<SysDept> {
    @Transactional(readOnly = true)
    SysDept findByNameAndParentId(@NotEmpty String name, @NotNull Integer parentId);

    @Transactional(readOnly = true)
    List<SysDept> findByParentId(@NotNull Integer parentId);

    @Transactional(readOnly = true)
    List<SysDept> findAllChildren(@NotNull Integer id);

    @Transactional(readOnly = true)
    List<Tree> findTree(@NotNull Integer parentId, boolean includeChild);
}
